package jmine.tec.hydra.dao;

import jmine.tec.hydra.domain.HydraRequestImpl;
import jmine.tec.purge.api.PurgeHelper;
import jmine.tec.purge.api.Purger;
import bancosys.tec.persist.dao.BaseDAO;
import bancosys.tec.utils.date.Date;

/**
 * Expurgador do Hydra.
 * 
 * @author Marcio Ribeiro (mmr)
 * @created Aug 18, 2011
 */
public class HydraRequestPurger extends BaseDAO<HydraRequestImpl> implements Purger {
    /**
     * {@inheritDoc}
     */
    public int purge(Date maxDate, int maxWindowSize) {
        return PurgeHelper.deleteWithPersister(this, createCriteria(), "requestEnd", maxDate, maxWindowSize);
    }

    /**
     * {@inheritDoc}
     */
    public int countItemsToPurge(Date maxDate) {
        return PurgeHelper.countItemsToPurge(createCriteria(), "requestEnd", maxDate);
    }
}
